<?php
namespace Amis\form;
class InputNumber extends FormItem
{
    public string $type = 'input-number';

    /**
     * @param $min
     * @return $this
     */
    public function min($min)
    {
        $this->min = $min;
        return $this;
    }

    /**
     * @param $max
     * @return $this
     */
    public function max($max)
    {
        $this->max = $max;
        return $this;
    }

    /**
     * 步长
     * @param int $step
     * @return $this
     */
    public function step(int $step)
    {
        $this->step = $step;
        return $this;
    }

    /**
     * 精度，即小数点后几位
     * @param int $precision
     * @return $this
     */
    public function precision(int $precision)
    {
        $this->precision = $precision;
        return $this;
    }

    /**
     * 是否显示上下点击按钮
     * @param bool $showSteps
     * @return $this
     */
    public function showSteps(bool $showSteps)
    {
        $this->showSteps = $showSteps;
        return $this;
    }

    /**
     * 前缀
     * @param string $prefix
     * @return $this
     */
    public function prefix(string $prefix)
    {
        $this->prefix = $prefix;
        return $this;
    }

    /**
     * 后缀
     * @param string $suffix
     * @return $this
     */
    public function suffix(string $suffix)
    {
        $this->suffix = $suffix;
        return $this;
    }

    /**
     * 千分分隔
     * @param bool $kilobitSeparator
     * @return $this
     */
    public function kilobitSeparator(bool $kilobitSeparator = false)
    {
        $this->kilobitSeparator = $kilobitSeparator;
        return $this;
    }
}